<div class="main-content">

    <div class="header bg-white a-shadow-light-s sticky-top">

        <div class="row mx-0">

            <ul class="col-12 col-xl-8 nav nav-tabs  mt-2 px-4">
                <li class="nav-item">
                    <a class="py-3 nav-link [if[::constants.Params.status=enabled::active]if]" href="#" onclick="Aps.query.addFilter('status','enabled')">
                        <span class="text-md">{i18n{ status.enabled }i18n}</span>
                    </a>
                </li>
                <li class="nav-item">
                    <a class="py-3 nav-link [if[::constants.Params.status=trash::active]if]" href="#" onclick="Aps.query.addFilter('status','trash')">
                        <span class="text-md">{i18n{ status.trash }i18n}</span>
                    </a>
                </li>
                <li class="nav-item">
                    <a class="py-3 nav-link [not[::constants.Params.status::active]not]" href="#" onclick="Aps.query.removeFilter('status')">
                        <span class="text-md">{i18n{ status.all }i18n}</span>
                    </a>
                </li>
            </ul>

            <div class="col-12 col-xl-4 nav-tabs">

                <div class="row my-2">

                    <form class="col ml-3" id="search" action="?search">
                        <div class="input-group input-group-flush">
                            <div class="input-group-prepend">
                                <span class="input-group-text"><i class="fe fe-search"></i></span>
                            </div>
                            <input class="form-control search" type="search" placeholder="{i18n{ enterKeyword }i18n}" name="keyword" value="{{constants.Params.keyword}}" required>
                        </div>

                    </form>

                    <button class="btn btn-sm btn-primary mr-3" type="submit" form="search">
                        {i18n{ Search }i18n}
                    </button>

                    <button class="btn btn-sm btn-white mr-3" type="button" onclick="Aps.query.clearFilter();">
                        {i18n{ Reset }i18n}
                    </button>


                </div>

            </div>


        </div>


        <div class="row mx-3 py-2">
            <div class="col-auto">
                <div class="dropdown my-2">
                    <button class="btn btn-sm dropdown-toggle [not[::constants.Params.categoryid::btn-white]not] [if[::constants.Params.categoryid::btn-secondary]if]" type="button" id="dropdownMenuButtonCategory" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        {i18n{ manager.category }i18n}
                    </button>
                    <div class="dropdown-menu" aria-labelledby="dropdownMenuButtonCategory" style="">
                        <a class="dropdown-item" href="" onclick="Aps.query.removeFilter('categoryid');" >{i18n{ status.all }i18n}</a>
                        ||loop??categoryList??
                        <a class="dropdown-item" href="" onclick="Aps.query.addFilter('categoryid','{{categoryid}}');" >{{description}}</a>
                        loop||
                    </div>
                </div>
            </div>

            <div class="col-auto">
                <div class="dropdown my-2">
                    <button class="btn btn-sm dropdown-toggle [not[::constants.Params.type::btn-white]not] [if[::constants.Params.type::btn-secondary]if]" type="button" id="dropdownMenuButtonTwo" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        {i18n{ manager.type }i18n}
                    </button>
                    <div class="dropdown-menu" aria-labelledby="dropdownMenuButtonTwo" style="">
                        <a class="dropdown-item" href="" onclick="Aps.query.removeFilter('type');" >{i18n{ status.all }i18n}</a>
                        <a class="dropdown-item" href="" onclick="Aps.query.addFilter('type','image');" >{i18n{ image }i18n}</a>
                        <a class="dropdown-item" href="" onclick="Aps.query.addFilter('type','audio');" >{i18n{ audio }i18n}</a>
                        <a class="dropdown-item" href="" onclick="Aps.query.addFilter('type','video');" >{i18n{ video }i18n}</a>
                        <a class="dropdown-item" href="" onclick="Aps.query.addFilter('type','document');" >{i18n{ document }i18n}</a>
                    </div>
                </div>
            </div>

            <div class="col-auto">
                <div class="dropdown my-2">
                    <button class="btn btn-sm dropdown-toggle [not[::constants.Params.sort::btn-white]not] [if[::constants.Params.sort::btn-secondary]if]" type="button" id="dropdownMenuButtonViewtimes" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        {i18n{ manager.sort }i18n}
                    </button>
                    <div class="dropdown-menu" aria-labelledby="dropdownMenuButtonViewtimes" style="">
                        <a class="dropdown-item" href="" onclick="Aps.query.removeFilter('sort');" >{i18n{ status.default }i18n}</a>
                        <a class="dropdown-item" href="" onclick="Aps.query.addFilter('sort','size DESC');" >{i18n{ manager.size }i18n} {i18n{ manager.sortDESC }i18n}</a>
                        <a class="dropdown-item" href="" onclick="Aps.query.addFilter('sort','size ASC');" >{i18n{ manager.size }i18n} {i18n{ manager.sortASC }i18n}</a>
                    </div>
                </div>
            </div>

            <div class="col-auto">
                <div class="dropdown my-2">
                    <button class="btn btn-sm btn-white dropdown-toggle" type="button" id="dropdownMenuButtonSize" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        <span class="fe fe-list mr-1"></span> {i18n{ manager.sizePerPage }i18n} [not[::constants.Params.size::10]not]{{constants.Params.size}}
                    </button>
                    <div class="dropdown-menu" aria-labelledby="dropdownMenuButtonSize" style="">
                        <a class="dropdown-item" href="" onclick="Aps.query.removeFilter('size');">{i18n{default}i18n}</a>

                        <a class="dropdown-item" href="" onclick="Aps.query.addFilter('size','8');">8</a>

                        <a class="dropdown-item" href="" onclick="Aps.query.addFilter('size','12');">12</a>

                        <a class="dropdown-item" href="" onclick="Aps.query.addFilter('size','24');">24</a>

                        <a class="dropdown-item" href="" onclick="Aps.query.addFilter('size','48');">48</a>

                        <a class="dropdown-item" href="" onclick="Aps.query.addFilter('size','120');">120</a>

                    </div>
                </div>
            </div>


        </div>


        [not[::articleList::
        <div class="row justify-content-center">
            <div class="col-12 col-md-8 col-xl-6 py-5">

                <h2>
                    {i18n{SYS_NON}i18n}
                </h2>

                <a href="" class="btn btn-primary lift" onclick="Aps.router.back(-1)">
                    {i18n{ back }i18n}
                </a>

            </div>
        </div>
        ]not]


    </div>


    <div class="container-fluid">
        <div class="row justify-content-center">
            <div class="col-12">


                <div class="row listAlias">


                    ||loop??articleList??
                    <div class="col-6 col-lg-4 col-xl-3 col-xxl-2">

                        <div class="card">

                            <div class="avatar avatar-xxl avatar-4by3 w-100">
                                [if[::type=image::
                                <img src="{{url}}!m" alt="preview" class="avatar-img rounded" onclick="Aps.gui.popup('Preview','<img class=w-100 src={{url}}!m>');">
                                ]if]
                                [if[::type=audio::
                                <audio src="{{url}}" alt="audio track" class="avatar-img rounded" controls></audio>
                                ]if]
                                [if[::type=video::
                                <video src="{{url}}" alt="video track" class="avatar-img rounded" controls preload="metadata">浏览器不支持视频标签，请使用现代浏览器如：Chrome,360极速,Safari,Firefox...</video>
                                ]if]
                            </div>

                            <div class="card-body">
                                <div class="row align-items-center">
                                    <div class="col">

                                        <h4 class="mb-2 name">
                                            {{size}}
                                        </h4>

                                        <p class="card-text small text-muted">
                                            {{createtime_}}
                                        </p>

                                    </div>


                                    <div class="col-auto">

                                        <div class="avatar-group">
                                            <a href="/manager/user/detail/{{author.userid}}" class="avatar avatar-xs" data-toggle="tooltip" title="{{author.nickname}}">
                                                <img src="{{author.avatar}}" alt="..." class="avatar-img rounded-circle">
                                            </a>
                                        </div>

                                    </div>

                                    <div class="col-auto">

                                        <div class="dropdown">
                                            <a href="#" class="dropdown-ellipses dropdown-toggle" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                                <i class="fe fe-more-vertical"></i>
                                            </a>
                                            <div class="dropdown-menu dropdown-menu-right">

                                                [if[::status=enabled::
                                                <a href="" class="dropdown-item" onclick="MANAGER.trash('{{mediaid}}','Media');"><span class="fe fe-trash-2 mr-2 text-warning"></span>{i18n{ manager.trash }i18n}</a>
                                                ]if]

                                                [if[::status^trash,offline::
                                                <a href="" class="dropdown-item" onclick="MANAGER.recover('{{mediaid}}','Media');"><span class="fe fe-check-circle mr-2 text-success"></span>{i18n{ manager.accept }i18n}</a>
                                                ]if]
                                                <a class="dropdown-item" onclick="MANAGER.deleteMedia('{{mediaid}}');"><span class="fe fe-delete mr-2 text-danger"></span>{i18n{ manager.delete }i18n}</a>
                                            </div>
                                        </div>

                                    </div>
                                </div>
                            </div>

                            <div class="card-footer card-footer-boxed">
                                <div class="row align-items-center">
                                    <div class="col">
                                        <div class="row align-items-center no-gutters">
                                            <div class="col-auto">

                                                <!-- Value -->
                                                <div class="small mr-2">{{url}}</div>
<!--                                                <div class="small mr-2">{{type}}</div>-->

                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>
                    loop||
                </div>

                <nav aria-label="Page navigation example">
                    <ul class="pagination">

                        [if[::pager.first::
                        <li class="page-item"><a class="page-link" href="#" onclick="Aps.query.addFilter('page','1')">{i18n{ firstPage }i18n}</a></li>
                        ]if]

                        [if[::pager.prev::
                        <li class="page-item"><a class="page-link" href="#" onclick="Aps.query.addFilter('page','{{pager.prev}}')">{i18n{ prevPage }i18n}</a></li>
                        ]if]

                        ||loop??pager.list??
                        [if[::current:: <li class="page-item active"><a class="page-link" href="#" >{{page}}</a></li> ]if]
                        [not[::current::<li class="page-item"><a class="page-link" href="#" onclick="Aps.query.addFilter('page','{{page}}')">{{page}}</a></li> ]not]
                        loop||

                        [if[::pager.next::
                        <li class="page-item"><a class="page-link" href="#" onclick="Aps.query.addFilter('page','{{pager.next}}')">{i18n{ nextPage }i18n}</a></li>
                        ]if]

                        [if[::pager.last::
                        <li class="page-item"><a class="page-link" href="#" onclick="Aps.query.addFilter('page','{{pager.last}}')">{i18n{ lastPage }i18n} ({{pager.last}})</a></li>
                        ]if]

                    </ul>
                </nav>


            </div>
        </div> <!-- / .row -->
    </div>
</div>